VERSION 5.00
Begin VB.Form VCTStageForm 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   11880
   LinkTopic       =   "Form1"
   ScaleHeight     =   9000
   ScaleWidth      =   11880
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Demographic_Button 
      Height          =   735
      Left            =   1440
      TabIndex        =   23
      Top             =   3600
      Width           =   975
   End
   Begin VB.CommandButton Report_Button 
      Height          =   735
      Left            =   6600
      TabIndex        =   21
      Top             =   3660
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.CommandButton ReprintVCTForm_Button 
      Height          =   735
      Left            =   6600
      TabIndex        =   19
      Top             =   2640
      Width           =   975
   End
   Begin VB.CommandButton ClientReg_Button 
      Height          =   735
      Left            =   1440
      TabIndex        =   6
      Top             =   2580
      Width           =   975
   End
   Begin VB.CommandButton LogOut_Button 
      BackColor       =   &H00C0C0C0&
      Caption         =   "Secure the workstation"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   7200
      TabIndex        =   1
      Top             =   360
      Width           =   4215
   End
   Begin VB.CommandButton ClinicVisit_Button 
      Height          =   735
      Left            =   1440
      TabIndex        =   8
      Top             =   7680
      Width           =   975
   End
   Begin VB.CommandButton HIVTest_Button 
      Height          =   735
      Left            =   1440
      TabIndex        =   7
      Top             =   5640
      Width           =   975
   End
   Begin VB.CommandButton PretestCounsel_Button 
      Height          =   735
      Left            =   1440
      TabIndex        =   5
      Top             =   4620
      Width           =   975
   End
   Begin VB.Timer Timer3 
      Interval        =   10000
      Left            =   11280
      Top             =   2640
   End
   Begin VB.Timer Timer2 
      Interval        =   1000
      Left            =   11280
      Top             =   2040
   End
   Begin VB.CommandButton PosttestCounsel_Button 
      Height          =   735
      Left            =   1440
      TabIndex        =   2
      Top             =   6660
      Width           =   975
   End
   Begin VB.Label Demographic_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Demographic Details"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2640
      TabIndex        =   24
      Top             =   3720
      Width           =   3375
   End
   Begin VB.Label REports_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Reports"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   7800
      TabIndex        =   22
      Top             =   3780
      Visible         =   0   'False
      Width           =   3855
   End
   Begin VB.Label Reprint_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "View / Print VCT Form"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   7800
      TabIndex        =   20
      Top             =   2760
      Width           =   3855
   End
   Begin VB.Label ClinicVisitCount_Data 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFFF&
      Caption         =   "(0)"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   18
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   540
      TabIndex        =   18
      Top             =   7740
      Visible         =   0   'False
      Width           =   855
   End
   Begin VB.Label PostTestCount_Data 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFFF&
      Caption         =   "(0)"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   18
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   540
      TabIndex        =   17
      Top             =   6720
      Visible         =   0   'False
      Width           =   855
   End
   Begin VB.Label HIVTestCount_Data 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFFF&
      Caption         =   "(0)"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   18
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   540
      TabIndex        =   16
      Top             =   5700
      Visible         =   0   'False
      Width           =   855
   End
   Begin VB.Label PreTestCount_Data 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFFF&
      Caption         =   "(0)"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   18
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   540
      TabIndex        =   15
      Top             =   4680
      Visible         =   0   'False
      Width           =   855
   End
   Begin VB.Label ClinicVisit_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Clinic Visit"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2640
      TabIndex        =   14
      Top             =   7800
      Width           =   2295
   End
   Begin VB.Label PosttestCounsel_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Risk Reduction Counseling"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2640
      TabIndex        =   13
      Top             =   6780
      Width           =   4575
   End
   Begin VB.Label HIVTest_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "HIV Testing"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2640
      TabIndex        =   12
      Top             =   5760
      Width           =   2295
   End
   Begin VB.Label PretestCounseling_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Risk Assessment"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2640
      TabIndex        =   11
      Top             =   4740
      Width           =   3375
   End
   Begin VB.Label ClientReg_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Client Registration"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2640
      TabIndex        =   10
      Top             =   2700
      Width           =   3375
   End
   Begin VB.Label Title_Label 
      Alignment       =   2  'Center
      BackColor       =   &H00C0FFFF&
      Caption         =   "MACRO Client Management Information System"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   24
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   600
      TabIndex        =   9
      Top             =   1800
      Width           =   10695
   End
   Begin VB.Label Date_Label 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Date"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   720
      TabIndex        =   4
      Top             =   840
      Width           =   3255
   End
   Begin VB.Label UserName_Label 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Username goes here ..."
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   720
      TabIndex        =   0
      Top             =   360
      Width           =   5775
   End
   Begin VB.Label Clock_Label 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Time"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4200
      TabIndex        =   3
      Top             =   840
      Width           =   2535
   End
   Begin VB.Shape Shape1 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   1  'Opaque
      BorderWidth     =   2
      FillColor       =   &H00FFFFFF&
      Height          =   1095
      Left            =   480
      Shape           =   4  'Rounded Rectangle
      Top             =   240
      Width           =   6375
   End
   Begin VB.Shape Shape2 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   1  'Opaque
      BorderWidth     =   2
      Height          =   7155
      Left            =   480
      Top             =   1620
      Width           =   10995
   End
End
Attribute VB_Name = "VCTStageForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Dim TimeCounter As Integer
'Private ShiftPressed As Boolean
'Private TempArr() As String

'This is for the barcode
'Public Sub System_KeyDown(KeyCode As Integer, Shift As Integer)
'
'   Select Case KeyCode
'      Case 48 To 57, 47, 80 'check for the $ sign
'         If (ShiftPressed And KeyCode) = 52 Then
'            TempArr() = Split(Pat_Barcode_Str, "/")
'            Pat_Dept = TempArr(0)
'            Pat_Num = TempArr(1)
'            Yr_Reg = TempArr(2)
'            RemoveHook
'            Pat_Details.Show
'            Unload Me
'         Else
'            ShiftPressed = False
'            Pat_Barcode_Str = Pat_Barcode_Str & Chr(KeyCode)
'         End If
'      Case 16
'         ShiftPressed = True
'   End Select
'End Sub

Private Sub ClientReg_Button_Click()
   RegMenuForm.Show
   Unload Me
End Sub

Private Sub ClinicVisit_Button_Click()
   ClinicClientForm.Show
   Unload Me
End Sub

Private Sub Demographic_Button_Click()
   PretestClientForm.Show
   Unload Me
End Sub



Private Sub Form_Load()

   'This is for the barcode scanner
   'SetHook Me, HFKeyDown
'   Pat_Barcode_Str = ""
'   ShiftPressed = False

   Clock_Label.Caption = "Time: " & Time
   Date_Label.Caption = "Date: " & StringDate
   UserName_Label.Caption = "User: " + TrimAll(UserFirst) + " " + TrimAll(UserLast)
   
   If ORGANIZATION = "MACRO" Then
      ClinicVisit_Button.Visible = True
      ClinicVisit_Label.Visible = True
'      ReprintVCTForm_Button.Visible = True
'      Reprint_Label.Visible = True
      Title_Label.Caption = "MACRO Client Management Information System"
   Else
      If ORGANIZATION = "LIGHTHOUSE" Then
         ClinicVisit_Button.Visible = False
         ClinicVisit_Label.Visible = False
'         ReprintVCTForm_Button.Visible = False
'         Reprint_Label.Visible = False
         Title_Label.Caption = "Lighthouse Client Management Information System"
      End If
   End If
      

'   If UserPwd = "999999" Then
'      ResetPrinterButton.Visible = True
'      ResetPrinterLabel.Visible = True
'   Else
'      ResetPrinterButton.Visible = False
'      ResetPrinterLabel.Visible = False
'   End If

'UpdatePreTestQueue
'UpdateHIVTestQueue
'UpdateRiskReductionQueue
'UpdateClinicQueue

End Sub

'Private Sub UpdatePreTestQueue()
'
'On Error GoTo Error1
'
'   'Count the number of clients in the pre-test queue
'   CnUser.Open ConnectString
'   Cmd.CommandText = "SELECT Count(*)" _
'                  & " FROM   client" _
'                  & " WHERE  VDATE = '" & StringDate & "'" _
'                  & " AND VISITTYP = '1'" _
'                  & " AND TIMEPRE IS NULL"
'   Cmd.CommandType = adCmdText
'   Cmd.ActiveConnection = CnUser
'   RsUser.Open Cmd, , adOpenStatic
'   If RsUser.EOF = False Then
'      PreTestCount_Data.Caption = "(" & RsUser(0) & ")"
'   End If
'   RsUser.Close
'   CnUser.Close
'   Exit Sub
'
'Error1:
'   MsgBox "There was a problem opening in UpdatePreTestQueue"
'   End
'
'End Sub

'Private Sub UpdateHIVTestQueue()
'
'On Error GoTo Error2
'
'   'Count the number of clients waiting for an HIV test
'   CnUser.Open ConnectString
'   Cmd.CommandText = "SELECT Count(*)" _
'                  & " FROM   client" _
'                  & " WHERE  (VDATE = '" & StringDate & "')" _
'                  & " AND (TIMEPRE IS NOT NULL)" _
'                  & " AND (VISITTYP = '1')" _
'                  & " AND (TIMELAB IS NULL)"
'   Cmd.CommandType = adCmdText
'   Cmd.ActiveConnection = CnUser
'   RsUser.Open Cmd, , adOpenStatic
'   If RsUser.EOF = False Then
'      HIVTestCount_Data.Caption = "(" & RsUser(0) & ")"
'   End If
'   RsUser.Close
'   CnUser.Close
'   Exit Sub
'
'Error2:
'   MsgBox "There was a problem opening in UpdateHIVTestQueue"
'   End
'
'End Sub

'Private Sub UpdateRiskReductionQueue()
'
'On Error GoTo Error3
'
'   'Count the number of clients waiting for post-test counseling
'   CnUser.Open ConnectString
'   Cmd.CommandText = "SELECT COUNT(*)" _
'                  & " FROM   client" _
'                  & " WHERE  VDATE = '" & StringDate & "'" _
'                  & " AND ((VISITTYP = '1'" _
'                  & " AND TIMELAB IS NOT NULL" _
'                  & " AND TIMEPOST IS NULL)" _
'                  & " OR (VISITTYP = '2'" _
'                  & " AND TIMEPRE IS NOT NULL" _
'                  & " AND TIMEPOST IS  NULL))"
'   Cmd.CommandType = adCmdText
'   Cmd.ActiveConnection = CnUser
'   RsUser.Open Cmd, , adOpenStatic
'   If RsUser.EOF = False Then
'      PostTestCount_Data.Caption = "(" & RsUser(0) & ")"
'   End If
'   RsUser.Close
'   CnUser.Close
'   Exit Sub
'
'Error3:
'   MsgBox "There was a problem opening in UpdateRiskReductionQueue"
'   End
'
'End Sub


'Private Sub UpdateClinicQueue()
'
'On Error GoTo Error4
'
'   'Count the number of clients waiting to see the clinical officer
'   CnUser.Open ConnectString
'   Cmd.CommandText = "SELECT COUNT(*)" _
'                  & " FROM   client" _
'                  & " WHERE  VDATE = '" & StringDate & "'" _
'                  & " AND TIMECLNC IS NULL" _
'                  & " AND (VISITTYP = 3 OR (VISITTYP <> '3'" _
'                  & " AND TIMEPOST IS NOT NULL" _
'                  & " AND (REFTO7 = '1' OR REFERRED <>0)))"
'   Cmd.CommandType = adCmdText
'   Cmd.ActiveConnection = CnUser
'   RsUser.Open Cmd, , adOpenStatic
'   If RsUser.EOF = False Then
'      ClinicVisitCount_Data.Caption = "(" & RsUser(0) & ")"
'   End If
'   RsUser.Close
'   CnUser.Close
'   Exit Sub
'
'Error4:
'   MsgBox "There was a problem opening in UpdateClinicQueue"
'   End
'
'End Sub

Private Sub HIVTest_Button_Click()
   HIVMenuForm.Show
   Unload Me
End Sub

'Private Sub HIVTestTimer_Timer()
'   HIVTestTimer.Interval = 10000
'   UpdateHIVTestQueue
'End Sub

Private Sub LogOut_Button_Click()
   LoginForm.Show
   Unload Me
End Sub

Private Sub PosttestCounsel_Button_Click()
   PosttestClientForm.Show
   Unload Me
End Sub

Private Sub PretestCounsel_Button_Click()
   RiskAssessForm.Show
   Unload Me
End Sub

'Private Sub PreTestTimer_Timer()
''   PreTestTimer.Interval = 10000
'   UpdatePreTestQueue
'End Sub

Private Sub Report_Button_Click()
   Reports_Form.Show
   Unload Me
End Sub

Private Sub ReprintVCTForm_Button_Click()
   ReprintVCTForm.Show
   Unload Me
End Sub

'Private Sub RiskReductionTimer_Timer()
'   'RiskReductionTimer.Interval = 10000
'   UpdateRiskReductionQueue
'End Sub

Private Sub Timer2_Timer()
   Clock_Label.Caption = "Time: " & Time
End Sub

Private Sub Timer3_Timer()
   Date_Label.Caption = "Date: " & StringDate
'   UpdatePreTestQueue
'   UpdateHIVTestQueue
'   UpdateRiskReductionQueue
'   UpdateClinicQueue
End Sub

